#ifndef ATTRIBUTE_HPP
#define ATTRIBUTE_HPP

class Attribute
{
    public:
        struct LAttr{
            string key;
            string value;
            string parent;
            LAttr* next;

            LAttr(string k = "", string v = "", string p = "", LAttr *n = NULL) :
                key(k), value(v), parent(p), next(n) {}
        };

        Attribute();
        virtual ~Attribute();

        void DelAllAttributes();
        void DelAttribute(string key);
        void GetAttributes();
        void ModAttribute(string key, string newKey, string newValue);
        void NewAttribute(string key, string value, string after);

        LAttr *GetAttrByParent(string name);

    private:
        LAttr *first, *last;
};

Attribute::Attribute(){
    first = new LAttr();
    last = first;
}

Attribute::~Attribute(){
    LAttr *current;
	while(first != NULL)
	{
		current = first;
		first = first->next;
		delete current;
	}
}

void Attribute::DelAllAttributes(){

}

void Attribute::DelAttribute(string key){

}

void Attribute::GetAttributes(){

}

void Attribute::ModAttribute(string key, string newKey, string newValue){

}

void Attribute::NewAttribute(string key, string value, string after){

}

Attribute::LAttr* Attribute::GetAttrByParent(string name){
    LAttr* current = first->next;

    while(current != NULL && current->parent != name){
        current = current->next;
    }

    return current;
}

#endif
